<template>
	<view class="rtl" v-show="showbg">

		<view class="shopCartMenu">
			<view class="title">
				<!-- 	<view class="back">

				</view> -->
				{{$attrs.title}}

			</view>
			<view class="content">
				<slot></slot>
			</view>
			<view class="footer" @click="BackCheck">
				{{t("Back")}}
			</view>

		</view>
		<view class="shield" @click="showbg=false">

		</view>
	</view>
</template>

<script setup>
	import {
		useAttrs,
		ref,
		onBeforeMount,
		defineExpose
	} from "vue";
	import {
		useI18n
	} from "vue-i18n";
	const {
		t
	} = useI18n()
	const $attrs = useAttrs();
	const showbg = ref(false)
	const emits = defineEmits(["prentCheck"]);
	const BackCheck = (item) => {
		showbg.value = false
		emits("prentCheck", item);
	};
	onBeforeMount(() => {
		if ($attrs.isShow) {
			showbg.value = $attrs.isShow
		}
	})
	const showSwitch = (bool) => {
		showbg.value = bool
	}
	defineExpose({
		showSwitch
	})
</script>

<style lang="scss" scoped>
	.shopCartMenu {
		position: fixed;
		z-index: 1;
		bottom: 0;
		left: 0;
		width: 100%;
		min-height: 40%;
		max-height: 60%;
		background: #fff;
		border-radius: 30rpx 30rpx 0 0;
		display: flex;
		flex-direction: column;

		.title {
			padding: 30rpx 20rpx;
			text-align: center;
			border-bottom: 1px solid #e9e9e9;
			position: relative;


			.reset {
				position: absolute;
				right: 20rpx;
				top: 50%;
				transform: translateY(-50%);
			}
		}

		.content {
			flex: 1;
			overflow-y: scroll;
			padding: 0 20rpx;
		}

		.footer {
			display: flex;
			align-items: center;
			justify-content: space-between;
			justify-content: center;
			padding: 30rpx 40rpx;
			background: #127B56;
			color: #fff;
			border-radius: 10rpx 10rpx 0 0;
			font-size: 28rpx;

			.Confrm {
				display: flex;
				align-items: center;
			}
		}
	}

	.shield {
		position: fixed;
		left: 0;
		top: 0;
		width: 100%;
		height: 100%;
		background: rgba(0, 0, 0, .5);
	}
</style>